<?php

require_once dirname(__FILE__)."/../model/user.php";
require_once dirname(__FILE__)."/../model/api.php";
global $_GPC,$_W;
$pwd=$_GPC['pwd'];
$newpwd=$_GPC['newpwd'];
$phone=$_GPC['phone'];
/*$user= getUser();*/
$request = postCurl(getServer()."/chgpasswd",array(
    "id"=>$phone,
    "oldpassword"=>$pwd,
    "newpassword"=>$newpwd
));



if($request["ret"]!=0){
    echo json_encode(array('status'=>false,'result'=>$request["msg"]),true);
    die();
}else{
    setUser($request['data']);
    echo json_encode(array('status'=>true,'result'=>"修改成功"),true);
    die();
}

